import { inject } from 'vue'
import { camelCase } from 'lodash-es'

export default function useInject(key) {
  const property = inject(key)
  const updateProperty = inject(camelCase(`update_${key}`))

  return {
    key: property,
    [camelCase(`update_${key}`)]: updateProperty,
  }
}
